package com.hxzy.servlet.umsrole;

import com.hxzy.entity.UmsRole;
import com.hxzy.service.UmsRoleService;
import com.hxzy.service.impl.UmsRoleServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/*
*  根据主键查询信息 显示到网页上
*/
@WebServlet(urlPatterns = "/hi")
public class SelectByPrimaryKey  extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        String value=req.getParameter("id");

        UmsRoleService service=new UmsRoleServiceImpl();
        UmsRole umsRole = service.selectByPrimaryKey(Long.parseLong(value));
        req.setAttribute("id",umsRole);
        req.getRequestDispatcher("index.jsp").forward(req,res);


    }
}
